border
:四周的框線,分別定義粗細、樣式、顏色,前後順序沒關係
border-left
:只加在左邊的框線border-right
:只加在右邊的框線border-bottom
:只加在下邊的框線border-top
:只加在上邊的框線<h1>標題1</h1>
<h2>標題2</h2>
<img src=" ">
h1 {
border: 1px solid pink;
}
h2 {
border-left: 1px solid red;
border-right: 1px solid blue;
border-bottom: 1px solid green;
border-top: 1px solid black;
}
img {
border: 5px solid #000000;
}
<div>
:作為區塊 (block) 容器,用來包 HTML 的內容<span>
:用來包文字 (inline) 的內容Reset CSS
或是連上這個網址:https://meyerweb.com/eric/tools/css/reset/
Reset CSS
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
繼續介紹 HTML 與 CSS 的搭配